package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.UUID;

@RestController
@Slf4j
public class OrderController {

   public static final String INVOKE_URL="http://consul-provider-payment";

   @Autowired
   private RestTemplate restTemplate;

    /**
     * 测试 url http://localhost/order/consul
     * @return
     */
    @RequestMapping(value = "/order/consul")
    public String paymentConsul(){

       String result =  restTemplate.getForObject(INVOKE_URL+"/payment/consul",String.class);
       return result;
    }
}
